<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Insert title here</title>

<jsp:include page="include/include.jsp" />

</head>
<body>
	<div class="container-fluid">
		<div class="row-fluid">
			<div class="col-md-12">
				<nav class="navbar navbar-default">
					<div class="container-fluid">
						<div class="navbar-header">
							<a class="navbar-brand" href="#">Brand</a>
						</div>
						<!-- Collect the nav links, forms, and other content for toggling -->
						<div class="collapse navbar-collapse"
							id="bs-example-navbar-collapse-1">
							<ul class="nav navbar-nav" id="topMenu">
								<li><a href="#">首页</a></li>
							</ul>
							<ul class="nav navbar-nav navbar-right">
								<li><a href='#'>${user.username}，欢迎你</a></li>
								<li><a href='#' class="glyphicon glyphicon-off" id="logout" ></a>
							</ul>
						</div>
						<!-- /.navbar-collapse -->
					</div>
					<!-- /.container-fluid -->
				</nav>
			</div>
		</div>
		<div class="row-fluid">
			<div class="span12">
				<div class="row-fluid">
					<div class="col-md-2">
						<ul class="nav nav-list">
							<li class="nav-header">列表标题</li>
							<li class="active"><a href="#">首页</a></li>
							<li><a href="#">库</a></li>
							<li><a href="#">应用</a></li>
							<li class="nav-header">功能列表</li>
							<li><a href="#">资料</a></li>
							<li><a href="#">设置</a></li>
							<li class="divider"></li>
							<li><a href="#">帮助</a></li>
						</ul>
					</div>
					<div class="col-md-10">
						<ul class="breadcrumb">
							<li><a href="#">主页</a> <span class="divider">/</span></li>
							<li><a href="#">类目</a> <span class="divider">/</span></li>
							<li class="active">主题</li>
						</ul>
						<table class="table">
							<thead>
								<tr>
									<th>编号</th>
									<th>产品</th>
									<th>交付时间</th>
									<th>状态</th>
								</tr>
							</thead>
							<tbody>
								<tr>
									<td>1</td>
									<td>TB - Monthly</td>
									<td>01/04/2012</td>
									<td>Default</td>
								</tr>
								<tr class="success">
									<td>1</td>
									<td>TB - Monthly</td>
									<td>01/04/2012</td>
									<td>Approved</td>
								</tr>
								<tr class="error">
									<td>2</td>
									<td>TB - Monthly</td>
									<td>02/04/2012</td>
									<td>Declined</td>
								</tr>
								<tr class="warning">
									<td>3</td>
									<td>TB - Monthly</td>
									<td>03/04/2012</td>
									<td>Pending</td>
								</tr>
								<tr class="info">
									<td>4</td>
									<td>TB - Monthly</td>
									<td>04/04/2012</td>
									<td>Call in to confirm</td>
								</tr>
							</tbody>
						</table>
					</div>
				</div>
			</div>
		</div>
	</div>

	<script type="text/javascript">
	<!-- 获取导航栏 -->
		$(function() {
			$.ajax({
				url : 'initNavTree',
				type : 'POST',
				dataType : 'json',
				success : function(data) {
					var len = data.length;
					for (var i = 0; i < len; i++) {
						$("#topMenu").append(
								"<li id='"+data[i].id+"'><a href='#' onclick='refreshLeftMenu('"+data[i].parentid+"')'>"
										+ data[i].menuname + "</a></li>");
					}
				},
				error : function(text) {
					alert(text.status + "->" + text.statusText);
				}

			});
		});

		
		//获取左侧菜单
		function refreshLeftMenu(id){
			alert(id);
		};

		//退出
		$(function(){
			$("#logout").on("click",function(){
				$.ajax({
					url:'logout',
					type:'POST',
					dataType:'text',
					success:function(msg){
						if(msg == "success"){
							alert("成功退出！");
							window.location.reload();
						}
						
					}
				});
			});
		});
	</script>
</body>
</html>